#{extends 'midas/content.html' /} 
#{set title:'Command Group Data' /} 
#{set header:'MML Command Group Data'/}
#{set 'toolbar'} 
	#{commandClassToolbar buttons:buttons/}
#{/set}
#{set verName:'GDVersion'/}
#{set authorName:'GDAuthor'/}
#{set emailName:'GDEmail'/}
#{set createdName:'GDDate'/}
#{set editHistoryName:'editHistory'/}
#{set revisionHistoryName:'revisionHistory'/}
#{set commentName:'Comments'/}
#{set stateName:'GDState'/}
#{set 'helpData'}
	<script src="@{'/public/javascripts/app/commandGroupDataHelp.js'}" type="text/javascript" charset="UTF-8"></script>
#{/set}
#{set 'renderScript'}
	<script type="text/javascript">	
		$(document).ready(function() {			
			render("/commandGroup/detail/" + $("input[name=id]").val());
		})			
	</script>
#{/set}
<fieldset>
	<legend>General Information - <span id="grammar"></span></legend>
	<input name="Grammar" type="hidden">

	<ul class="sl-table">
		<li>
			<label help="GDClass">MML Command Class</label> 
			<input name="GDClass" type="text" class="read width300 NewVer">
		</li>
		<li>
			<label help="GDAcceptedDate">Accepted</label> 
			<input name="GDAcceptedDate" type="text" class="readOnly width300">
		</li>
		<li>
			<label help="GDMMLID">MML Name</label> 
			<input id="GDMMLID" type="text" class="readOnly width300">
			<select name="GDMMLID" class="edit width300">
			#{list items:MMLIDs, as:'MMLID'}
				<option value="${MMLID}">${MMLID}</option>
			#{/list}
			</select>
		</li>
		<li>
			<label help="GDGroup">Group Letter</label> 
			<input id="GDGroup" type="text" class="readOnly width300">
			<input name="GDParallel" type="hidden">
			<select name="GDGroup" class="edit width300">
			#{list items:letters, as:'letter'}
				<option value="${letter}">${letter}</option>
			#{/list}
				<option value="usedLetter">Select group letter already in use</option>
			</select>
		</li>
		<li id="inUseLetters">
			<label help="GDGroup">Group Letter in use *</label> 
			<select id="GDGroupwww" class="edit width300">
			#{list items:usedLetters, as:'usedLetter'}
				<option value="${usedLetter}">${usedLetter}</option>
			#{/list}
			</select>
		</li>
		<li>
			<label help="GDGType">Group Type</label> 
			<input name="GDGType" type="text" class="readOnly width300">
		</li>
		<li>
			<label help="GDEnMenuText">English Menu Text *</label> 
			<input id="GDEnMenuText" type="text" class="read width300">
			<input name="GDEnMenuText" type="text" class="edit width300">
		</li>
		<li>
			<label help="GDProgFunc">Program's Funtion *</label> 
			<testarea id="GDProgFunc" class="read width300" rows="4" cols="5"></testarea>
			<testarea name="GDProgFunc" class="edit width300" rows="4" cols="5"></testarea>
		</li>
		<li>
			<label help="GDLayer">Software Layer *</label>
			<input id="GDLayer" type="text" class="read width300">
			<select name="GDLayer" class="edit width300">
			#{list items:layers, as:'layer'}
				<option value="${layer}">${layer}</option>
			#{/list}
			</select>
		</li>
		<li>
			<label>Software Build(s) *</label>
			#{softwarebuilds /}
		</li>
		<li>
			<label help="GDStatus">Command Program Status *</label>
			<input id="GDStatus" type="text" class="read">
			<table class="edit" >
			#{list items:states, as:'state'}
				<tr><td><input type="radio" name="GDStatus" value="${state}"/>${state}</td></tr>
			#{/list}
			</table>
		</li>
	</ul>

</fieldset>
<br />
<script type="text/javascript">
	function sepcailRender(){
		renderSB();
		grammarRender();
		$("#inUseLetters").hide();
	}
	function beforeSubmit(){
		getChoseGroupLetter();
	}
	function changeGroupLetter(){
		if($(this).val() == "usedLetter"){
			$("#inUseLetters").show();
			$("input[name=GDParallel]").val("false");
		}else{
			$("#inUseLetters").hide();
			$("input[name=GDParallel]").val("true");
		}
	}
	function getChoseGroupLetter(){
		if($("input[name=GDParallel]").val()){
			$("#GDGroup").append($("#GDGroupwww option:selected"));
			$("#GDGroup").val($("#GDGroupwww").val());
		}
	}
</script>